# $Id$
# Maintainer: Gaetan Bisson <bisson@archlinux.org>
# Contributor: Thomas Bächler <thomas@archlinux.org>
# Contributor: Giovanni Scafora <giovanni@archlinux.org>

pkgname=rfkill
pkgver=0.5
pkgrel=2
pkgdesc='Tool for enabling and disabling wireless devices'
url='http://wireless.kernel.org/en/users/Documentation/rfkill'
license=('custom')
arch=('i686' 'x86_64')
validpgpkeys=('C0EBC440F6DA091C884D8532E0F373F37BF9099A')
source=("https://www.kernel.org/pub/software/network/${pkgname}/${pkgname}-${pkgver}.tar"{.xz,.sign}
        'service.unblock'
        'service.block'
        'sysusers.d'
        'rules.d')
sha256sums=('e0ae3004215e39a6c5c36e0726558740728d16f67ebdb8bea621250f6091d86a'
            'SKIP'
            '8ccec10a22523f6b9d55e0d6cbf91905a39881446710aa083e935e8073323376'
            'a22e0a037e702170c7d88460cc9c9c2ab1d3e5c54a6985cd4a164ea7beff1b36'
            '4a0b3dd8aa6d34dd29e1d153f396cacf908b0d64f7218276cbcab684587c0a0a'
            '7423aaaa09fee7f47baa83df9ea6fef525ff9aec395c8cbd9fe848ceb2643f37')

build() {
	cd "${srcdir}/${pkgname}-${pkgver}"
	make
}

package() {
	cd "${srcdir}/${pkgname}-${pkgver}"
	make SBINDIR=/usr/bin DESTDIR="${pkgdir}" install
	install -Dm644 COPYING "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
	install -Dm644 ../rules.d "${pkgdir}/usr/lib/udev/rules.d/60-rfkill.rules"
	install -Dm644 ../sysusers.d "${pkgdir}/usr/lib/sysusers.d/rfkill.conf"
	install -Dm644 ../service.block "${pkgdir}/usr/lib/systemd/system/rfkill-block@.service"
	install -Dm644 ../service.unblock "${pkgdir}/usr/lib/systemd/system/rfkill-unblock@.service"
}
